package refactor.pullupmethod;

import java.util.Date;

public abstract class Customer {
    private Date lastBillDate;
    private double charge;

    protected void addBill(Date date, double charge) {
        charge += 1;
    }

    public void createBill(Date date) {
        double chargeAmount = chargeFor(lastBillDate, date);
        addBill(date, charge);
    }

    protected abstract double chargeFor(Date lastBillDate, Date date);
}
